import hh.util.CommonUtil;
import org.openjdk.jol.info.ClassLayout;

import java.util.ArrayList;
import java.util.List;

public class BiasLockDemo {
    public static void main(String[] args) throws InterruptedException {
        BiasLockDemo b = new BiasLockDemo();
//        BiasLockDemo2.print(b);
//        b.hashCode();
        BiasLockDemo2.print(b);
        
        
        synchronized (b
        ) {
            BiasLockDemo2.print(b);
        }
        CommonUtil.sleep(1000);
        System.gc();;
        new Thread(()->{
            synchronized (b) {
                BiasLockDemo2.print(b);
                CommonUtil.sleep(2000);
            }
            
        }).start();
        
         CommonUtil.sleep(1000);
        BiasLockDemo2.print(b,"123");
        new Thread(()->{
            synchronized (b) {
                BiasLockDemo2.print(b);
            }
        }).start();
        
        CommonUtil.sleep(1000);
        BiasLockDemo2.print(new BiasLockDemo());
    }
}
